-
Notifications
You must be signed in to change notification settings - Fork 7
[SCFD-3113] Added validation that vector should not contain None components #515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dimensioned_value = unyt_type(value["value"], value["units"], dtype=np.float64) | ||
# Check for Nan. This usually is a result of None being in the input value. | ||
# with dtype=np.float64, None will be converted to np.nan. | ||
# We need (IIRC) np.float64 to ensure consistent hashing | ||
if kwargs.get("allow_inf_nan", False) is False: | ||
if np.ndim(dimensioned_value.value) == 0 and np.isnan(dimensioned_value.value): | ||
raise ValueError("NaN or None found in input scalar which is not allowed.") | ||
if np.ndim(dimensioned_value.value) > 0 and any(np.isnan(dimensioned_value.value)): | ||
raise ValueError("NaN or None found in input array which is not allowed.") | ||
return dimensioned_value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we put this logic to a separate validator and keep this validator only a parser? See the logic of _VectorType.validate()
it checks step by step all conditions, it is easier to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com>
* added 0m as default inner radius (#542) * Fix wrong item type for forking a case (#544) * Add from_local_storage function for creating geometry instance with local geometry file (#554) * Add from_local_storage function for geometry. * Add new TimeAverage output to new_simulation_model.py * Fix Formatting * Address comments * Address comment * fix(): windows will use \ as path separator, but aws s3 only accept / as path separator (#551) Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com> * [SCFD-3093] added support for user defined Fairfield (#558) * added support for user defined farfield * Fix lint * Fixed rotation zone tranlsation (#557) * Added user defined fields support for V2.0 Flow360 (#560) * Added user defined fields support for V2.0 Flow360 * Fix unit tests * Comments addressed * Fix unit test (#563) * added support for x slicing force distribution and y slicing force distribution (#561) * added support for x slicing force distribution and y slicing force distribution * fixed isort * added missing data * adderessed PR comments --------- Co-authored-by: Ben <106089368+benflexcompute@users.noreply.github.com> * Fixed when setting param's entity_info, the tags are not included (#552) * Added validation that `parent_volume` also needs to be rotating (#566) * Added validaiton that parent_volume also needs to be rotating * Removed print * Fixed the UDD translation by removing the output target (#567) * Beta 24.11 (#570) * added CI for the branch * Flow360 2.0 documentation for volume_models, solver_numerics and outputs modules (#519) * Test edit on VolumeOutput * Re-commit documentation change * Address comments --------- Co-authored-by: Ben <106089368+benflexcompute@users.noreply.github.com> * Grouping V1 python client components so they are not exposed directly to user. (#529) * Grouped V1 unit tests and removed unused fixtures * Added missing files * moved flow360_params folder as v1 folder * added flow360/component/constants.py back * Fixed unit tests * Moved previous root level modules to v1 * Fixed bug in error message * Fixed circular import * Fix lint * Fixed unit tests * Fixed unit test * Fix lint * rm new_simulation_models.py since it is copied as __init__.py * comments addressed * Added back gitignore for mesh files since we do not need them in the repo (they come from cloud) * Fixed linting * Deleting cgns * deleted the new_simulation_models.py which is repalced by __init__.py * Rename `__init__.py` from v1 folder as modules.py (#541) * Lint fixed. now need to fix unit system conflict * Fixed unit system conflict by renaming it * Moved modules.py to v1.py * comment addressed * Add documentation for after reorganization (#543) * Add sphinx params plugins * Add more documentations * Update Flow360 * Update solver_numerics * Fix isort --------- Co-authored-by: Ben <106089368+benflexcompute@users.noreply.github.com> * Ben y/add missing sphinx package (#545) * Added sphinx-paramlinks * Add more dependencies * Update Isosurface related docs (#546) * Ben y/add meshing and exmp (#547) * WIP-1 * WIP * Fix lint * Fixed unit test * Fix unit test * Added more examples * fix(): windows will use \ as path separator, but aws s3 only accept / as path separator (#551) Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com> * Update flow360/component/simulation/models/surface_models.py Co-authored-by: yifan-flex <124317394+yifan-flex@users.noreply.github.com> * Update flow360/component/simulation/models/surface_models.py Co-authored-by: yifan-flex <124317394+yifan-flex@users.noreply.github.com> * Add documentation for operating condition (#556) * Add documentation for operating condition * Address PR comments * Removed the blank line that cause doc confusion (#564) * Update init for documentation (#568) * Sphinx warning fixes * Add operating condition function * Fix sphinx warnings * Minor fix --------- Co-authored-by: angranl-flex <angran@flexcompute.com> Co-authored-by: JunchengXue <97111055+JunchengXue@users.noreply.github.com> Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com> Co-authored-by: yifan-flex <124317394+yifan-flex@users.noreply.github.com> * [SCFD-3148] Added private_attribute_id for all entities (#550) * Added private_attribute_id for all entities to ensure that front end entity tracking still works * Testing through deploying * Fixed unit test * Fixed unit test and removed unnecessary changes * Fix linting * Commments addressed * Fix UDD class (#571) * Replaced str with StringExpression (#569) * Replaced str with StringExpression * Updated a more comprehensive list * [SCFD-2744] [SCFD-2069] Added BC completeness check (#489) * Added BC completeness check * Fixing unit test * Fixed unit test * Fix lint * Update flow360/component/simulation/validation/validation_simulation_params.py Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com> * Update flow360/component/simulation/validation/validation_simulation_params.py Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com> * Fixed the unit test * FIX UNIT TEST * Added guard on the validation level --------- Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com> * Fix Transition Solver Field and Add Conflict Fields Unit Test (#574) * Fix Transition Solver Field and add conflict fields unit test * Add validators for TransitionModelSover * Update function name * Formatting * [SCFD-3113] Added validation that vector should not contain None components (#515) * [SCFD-3113] Added validation that vector should not contain None components * Moved the implementation into a dedicated validator * Fixed unit test * Update flow360/component/simulation/unit_system.py Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com> --------- Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com> * Prepare for 24.11.0b1 release * update version for b2 release * [SCFD-2695] Reworked the manipulate restart mechanism (#575) * Reworked the manipulate restart mechanisim * Fix format --------- Co-authored-by: Maciej Skarysz <83596707+maciej-flexcompute@users.noreply.github.com> Co-authored-by: angranl-flex <angran@flexcompute.com> Co-authored-by: JunchengXue <97111055+JunchengXue@users.noreply.github.com> Co-authored-by: yifan-flex <124317394+yifan-flex@users.noreply.github.com>
No description provided.